package com.neuedu.his.controller;

import com.neuedu.his.service.ChargeService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

import java.util.List;
import java.util.Map;

@RestController
@RequestMapping("/charge")
public class ChargeController {

    @Autowired
    private ChargeService chargeService;

    @PostMapping("/item")
    public boolean chargeItem(@RequestBody Map<String, Integer> params) {
        Integer id = params.get("id");
        return chargeService.chargeItem(id);
    }

    @PostMapping("/all")
    public boolean chargeAll(@RequestBody Map<String, List<Integer>> params) {
        List<Integer> ids = params.get("ids");
        return chargeService.chargeAll(ids);
    }
}